//
//  SettingsTest.cpp
//  gre
//
//  Created by Kutlak Roman on 01/04/2012.
//  Copyright (c) 2012 University of Aberdeen. All rights reserved.
//

#include <iostream>
#include <string>

#include <gtest/gtest.h>

#include "Settings.h"

using std::string;
using namespace kutlak::roman::gre;

TEST(Settings, Lifecycle)
{
    Settings s("/Users/roman/.gre/gre.settings");
    Settings& s2 = Settings::Instance();
    EXPECT_EQ(s.GetSetting("UseProxy"), s2.GetSetting("UseProxy"));
}

TEST(Settings, Env)
{
    string home = Settings::GetEnvironmentVar("HOME");
    EXPECT_EQ("/Users/romankutlak", home);
}

TEST(Settings, GetSetting)
{
    Settings& s = Settings::Instance();
    EXPECT_EQ("", s.GetSetting("non_existent_value"));
    EXPECT_NE("", s.GetSetting("UseProxy"));
}
